#ifndef DELAY2_H_
#define DELAY2_H_

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include "stm32f10x.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_tim.h"
#include "misc.h"
#include "LCD16x2.h"

extern volatile uint32_t __counter_micros;
extern volatile uint32_t __counter_millis;
extern volatile uint32_t __countdown_millis;

/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macro ------------------------------------------------------------*/
/* Exported functions ------------------------------------------------------- */

uint32_t millis(void);

void TIM2_delaytimer_start(void);
void TIM2_delaytimer_up(void);
void TIM2_delaytimer_reset(void);
void TIM2_IRQHandler(void);
void reset_count();

void countdown_start(uint32_t t);
uint8_t countdown_expired(void);

#endif /* DELAY5_H_ */
